<template>
    <!-- <i class="iconfont" :class="iconName"></i> 自动合并class -->
    <i :class="'icon-container iconfont ' + iconName"></i>
</template>

<script>
const classMap = {
  home: "iconzhuye", //规范化图标名称
  success: "iconzhengque",
  error: "iconcuowu",
  close: "iconguanbi",
  warn: "iconjinggao",
  info: "iconxinxi",
  blog: "iconblog",
  code: "iconcode",
  about: "iconset_about_hov",
  weixin: "iconweixin",
  mail: "iconemail",
  github: "icongithub",
  qq: "iconsign_qq",
  arrowUp: "iconiconfonticonfonti2copy",
  arrowDown: "iconiconfonticonfonti2",
  empty: "iconempty",
  chat: "iconliuyan",
};
export default {
    props:{
        type:{
            type:String,
            required:true,
        }
    },
    computed:{
        // 转换图标名称
        iconName(){
            return classMap[this.type]
        }
    },
}
</script>

<style scoped lang="less">
/* 这个//at.alicdn.com/t/font_2164449_nalfgtq7il.css没有写协议，当使用时会自动添加上服务器的协议http */
@import "//at.alicdn.com/t/font_2164449_nalfgtq7il.css";
</style>